//package com.office.supplies.config;
//
//import org.dromara.x.file.storage.spring.SpringFileStorageProperties;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//
///**
// * @Author admin
// * @Description
// * @Date 2025/02/18/17:17
// */
//@Configuration
//public class XFileStorageWebMvcConfigurer implements WebMvcConfigurer {
//
//    @Autowired
//    private SpringFileStorageProperties properties;
//
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        for (SpringFileStorageProperties.SpringLocalConfig local : properties.getLocal()) {
//            if (local.getEnableStorage() && local.getEnableAccess()) {
//                registry.addResourceHandler(local.getPathPatterns())
//                        .addResourceLocations("file:" + local.getBasePath());
//            }
//        }
//        for (SpringFileStorageProperties.SpringLocalPlusConfig localPlus : properties.getLocalPlus()) {
//            if (localPlus.getEnableStorage() && localPlus.getEnableAccess()) {
//                registry.addResourceHandler(localPlus.getPathPatterns())
//                       .addResourceLocations("file:" + localPlus.getStoragePath());
//            }
//        }
//    }
//
//}
